#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>
#include <QHBoxLayout>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton *but1 = new QPushButton("按钮1");
    QPushButton *but2 = new QPushButton("按钮2");

    QHBoxLayout *lay = new QHBoxLayout();

    // 设置空白
    QSpacerItem *item = new QSpacerItem(100,10);

    // 插入表单
    lay->addWidget(but1);
    lay->addSpacerItem(item);
    lay->addWidget(but2);
    // 挂到widget
    this->setLayout(lay);
}

Widget::~Widget()
{
    delete ui;
}
